home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / objc / HashTable.h < prev    next >
Text File  |  1991-10-09  |  2KB  |  79 lines

  1. /*
  2.     HashTable.h
  3.     Copyright 1988, 1989 NeXT, Inc.
  4.     
  5.     DEFINED AS: A common class
  6.     HEADER FILES: objc/HashTable.h
  7.  
  8. */
  9.  
  10. #ifndef _OBJC_HASHTABLE_H_
  11. #define _OBJC_HASHTABLE_H_
  12.  
  13. #import <objc/Object.h>
  14. #import <objc/hashtable.h>
  15. #import <objc/typedstream.h>
  16.  
  17. @interface HashTable: Object
  18. {
  19.     unsigned    count;        /* Current number of associations */
  20.     const char    *keyDesc;    /* Description of keys */
  21.     const char    *valueDesc;    /* Description of values */
  22.     unsigned    _nbBuckets;    /* Current size of the array */
  23.     void    *_buckets;    /* Data array */
  24. }
  25.  
  26. /* Initializing */
  27.  
  28. - init;
  29. - initKeyDesc: (const char *)aKeyDesc;
  30. - initKeyDesc:(const char *)aKeyDesc valueDesc:(const char *)aValueDesc;
  31. - initKeyDesc: (const char *) aKeyDesc valueDesc: (const char *) aValueDesc 
  32.     capacity: (unsigned) aCapacity;
  33.  
  34. /* Freeing */
  35.  
  36. - free;    
  37. - freeObjects;
  38. - freeKeys:(void (*) (void *))keyFunc values:(void (*) (void *))valueFunc;
  39. - empty;
  40.  
  41. /* Copying */
  42.  
  43. - copyFromZone:(NXZone *)zone;
  44.   
  45. /* Manipulating */
  46.  
  47. - (unsigned)count;
  48. - (BOOL)isKey:(const void *)aKey;
  49. - (void *)valueForKey:(const void *)aKey;
  50. - (void *)insertKey:(const void *)aKey value:(void *)aValue;
  51. - (void *)removeKey:(const void *)aKey;
  52.  
  53. /* Iterating */
  54.  
  55. - (NXHashState)initState;
  56. - (BOOL)nextState:(NXHashState *)aState key:(const void **)aKey 
  57.     value:(void **)aValue;
  58.  
  59. /* Archiving */
  60.  
  61. - write:(NXTypedStream *)stream;
  62. - read:(NXTypedStream *)stream;
  63.  
  64. /*
  65.  * The following new... methods are now obsolete.  They remain in this 
  66.  * interface file for backward compatibility only.  Use Object's alloc method 
  67.  * and the init... methods defined in this class instead.
  68.  */
  69.  
  70. + new;
  71. + newKeyDesc: (const char *)aKeyDesc;
  72. + newKeyDesc:(const char *)aKeyDesc valueDesc:(const char *)aValueDesc;
  73. + newKeyDesc:(const char *)aKeyDesc valueDesc:(const char *)aValueDesc 
  74.     capacity:(unsigned)aCapacity;
  75.  
  76. @end
  77.  
  78. #endif /* _OBJC_HASHTABLE_H_ */
  79.